using System;
using System.Web.UI.WebControls;

namespace ConcursoCV.UI.Helper
{
	/// <summary>
	/// Summary description for ControlFactoryHelper.
	/// </summary>
	public class ControlFactoryHelper
	{
		public static WebControl GetControl(string type)
		{
			WebControl control = null;
			switch(type)
			{
				case "TXT": //Text Box
					control = new TextBox();
					break;
				case "CBX": // Combo Box
					control = new DropDownList();
					break;
				case "DTP": // Date Time Picker
					control = new Pluspetrol.Core.UIControls.WebControls.CDatePicker();
					break;
				case "TXA": // Text Box con multiline
					control = new TextBox();
					((TextBox)control).TextMode = TextBoxMode.MultiLine;
					break;
				case "CBM": // ComboMeses
					control = new DropDownList();
					break;
				case "CBA": // ComboAnios
					control = new DropDownList();
					break;
				default:
					control = new TextBox();
					break;
			}
			return control;
		}
	}
}
